package com.service;

import com.dao.ContactMapper;
import com.pojo.Contact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ContactServiceImpl implements ContactService{
    @Autowired
    private ContactMapper contactMapper;

//    public List<Contact> list(Integer pageIndex, Integer pageSize) {
//        return contactMapper.list(pageIndex, pageSize);
//    }

    @Override
    public int count(String cname) {
        return contactMapper.count(cname);
    }

    @Override
    public List<Contact> sous(Integer pageIndex,Integer pageSize,String cname) {
        return contactMapper.sous(pageIndex, pageSize,cname );
    }

    @Override
    public int add(Contact contact) {
        return contactMapper.add(contact);
    }

    @Override
    public Contact byId(Integer id) {
        return contactMapper.byId(id);
    }

    @Override
    public int update(Contact contact) {
        return contactMapper.update(contact);
    }
}
